#include<stdio.h>
int main(){
	int length;
	scanf("%d",&length);
	int numbers[length];
	for(int i=0;i<length;i++)
	scanf("%d",&numbers[i]);
	int target;
	scanf("%d",&target);
	for(int i=0;i<length;i++){
		int low=i+1,high=length-1;
		while(low<=high){
			int mid=(high-low)/2+low;
			if(numbers[mid]==target-numbers[i]){
				printf("[%d,%d]",i,mid);
				break;
			}else if(numbers[mid]>target-numbers[i]){
				high=mid-1;
			}else{
				low=mid+1;
			}
		}
	}
	return 0;
}
